<!--
 * @Author: zi.yang
 * @Date: 2021-03-11 23:18:57
 * @LastEditors: zi.yang
 * @LastEditTime: 2021-03-11 23:57:59
 * @Description: In User Settings Edit
 * @FilePath: \vue-music\src\components\state\test-three.vue
-->

<template>
  <div>ref() 方法测试 ： {{ count }} </div>
</template>

<script>
import { ref } from '@vue/composition-api';

export default {
  name: 'test-three',
  setup() {
    // 为解决 return 返回一个 state 对象，引申使用 ref
    const count = ref(0);

    setInterval(() => {
      // ref 需要通过 .value 的形式注入值
      count.value += 7;
    }, 1500);

    return { count };
  },
};

</script>

<style scoped>
  div {
    color : blue;
  }

</style>
